/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Modele;

import java.awt.Color;
import java.awt.Point;
import java.awt.Polygon;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Zanna Bianca
 */
public class Pont extends Graphique{
    
   /*
    * On va déterminer les ponts sur le graphique
    */
    private Polygon pol;
    private final List<Point> valCor = new ArrayList<Point>();
    private Color cl = Color.YELLOW;
    
   public Pont(){
       this.setValCor(new Point(0,0), new Point(0,0));
   }

   
    public void setValCor(Point valCorX, Point valCorY) {
        this.getValCor().add(valCorX);
        this.getValCor().add(valCorY);
        
    }
    

    @Override
    public boolean contains(int x, int y){
        return getPol().contains(new Point(x,y));
    }

    /**
     * @return the pol
     */
    public Polygon getPol() {
        return pol;
    }

    /**
     * @param pol the pol to set
     */
    public void setPol(Polygon pol) {
        this.pol = pol;
    }

    /**
     * On va préciser que les ponts doivent être pareil.
     */
 
    public boolean equals(Pont pt){
        Point pt1 = this.getValCor().get(0);
        Point pt2 = this.getValCor().get(1);
        if(pt.getValCor().contains(pt1)){
            if(pt.getValCor().contains(pt2)){
                for(Point point : this.pl){
                return false;
            }
            return true;
            }       
        }
        return false;
    }

    /**
     * @return the valCor
     */
    public List<Point> getValCor() {
        return valCor;
    }

    /**
     * @return the cl
     */
    public Color getCl() {
        return cl;
    }

    /**
     * @param cl the cl to set
     */
    public void setCl(Color cl) {
        this.cl = cl;
    }
    
}
